﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Services;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Ortodoctor.Funcionario
{
    public partial class Principal : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {            
            if (Session["USUARIO"] == null)
                Response.Redirect("Login.aspx");
            else if (Session["alerta"] != null && Session["alerta"].ToString().Equals("ERRO"))
                Response.Redirect("Comparecimento.aspx");

        }

        [WebMethod]
        public static String getInfo()
        {
            return 
                (HttpContext.Current.Session["USUARIO"] + "%" + HttpContext.Current.Session["USUARIO_ACESSO"] + "%" +
                HttpContext.Current.Session["ID_USUARIO_ACESSO"] + "%" + HttpContext.Current.Session["ID_CLINICA"]);

        }

        [WebMethod]
        public static string confereData(string data)
        {
            try
            {
                Convert.ToDateTime(data);
                return "ok";
            }
            catch
            {
                return "erro;";
            }
        }
    }
}